<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String contextPath=request.getContextPath();
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+contextPath+"/";
pageContext.setAttribute("basePath",basePath);
request.setAttribute("contextPath", contextPath);
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<title>book显示</title>
</head>
<body>
<c:if test="${not empty LOGIN_USER_KEY_IN_SESSION }">
<b>${LOGIN_USER_KEY_IN_SESSION.userName }</b>欢迎你!
</c:if>
<c:if test="${not empty list }">
	<table width="80%" border="1">
	<tr>
		<td>图书Id</td>
		<td>平均分</td>
		<td>作者</td>
		<td>书籍描述</td>
		<td>图书图片</td>
		<td>书名</td>
		<td>图书原价</td>
		<td>图书特价</td>
		<td>出版社</td>
		<td>目录名</td>
		<td>ISBN</td>
		<td>存货数量</td>
	</tr>
	<c:forEach items="${list }" var="map">
	<tr>
		<td>${map.bookId }</td>
		<td>${map.averageNumber }</td>
		<td>${map.bookAuthor }</td>
		<td>${map.bookDescription }</td>
		<td>${map.bookImg }</td>
		<td>${map.bookName }</td>
		<td>${map.bookPrice }</td>
		<td>${map.specialPrice }</td>
		<td>${map.bookImg }</td>
		<td>${map.bookPub }</td>
		<td>${map.categoryName }</td>
		<td>${map.ISBN }</td>
		<td>${map.stockNumber }</td>
		<td><a href="${contextPath}/listComment/${map.bookId}"/>查看评论</a></td>
		<td><a href="${contextPath}/addComment/${map.bookId}"/>增加评论</a></td>				
		<td><a href="${contextPath}/book/${map.bookId}/order"/><b>下订单</b></a></td>				
	</tr>
	</c:forEach>
	</table>
</c:if>
<c:if test="${not empty comments }">
	<b>该图书评论</b>
	<table width="80%" border="1">
		<tr>
			<td>commentId</td>
			<td>fromAuthor</td>
			<td>bookId</td>
			<td>createTime</td>
			<td>isDelete</td>
			<td>description</td>
			<td>操作</td>
		</tr>
		<c:forEach items="${comments }" var="comment">
			<tr>
				<td>${comment.bookId }</td>
				<td>${comment.fromAuthor }</td>
				<td>${comment.bookId }</td>
				<td>${comment.createTime }</td>
				<td>${comment.isDelete }</td>
				<td>${comment.description }</td>
			</tr>
		</c:forEach>
	</table>
	
</c:if>
</body>
</html>